package com.founder.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.founder.dao.UserMapper;
import com.founder.model.User;
import com.founder.service.IUserService;
import com.github.pagehelper.Page;

@Service("userService")
public class UserService implements IUserService {
	@Autowired
	private UserMapper userMapper;
	@Override
	public Page<User> pageUser(int pageNum, int pageSize, String keyWord) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public User getUser(String name) {
		// TODO Auto-generated method stub
		return userMapper.getUser(name);
	}

	@Override
	public boolean addUser(User user) {
		// TODO Auto-generated method stub
		return userMapper.insert(user) == 1 ? true:false;
	}

	@Override
	public boolean modUser(User user) {
		// TODO Auto-generated method stub
		return userMapper.updateByPrimaryKeySelective(user)== 1 ? true:false;
	}

	@Override
	public boolean delUserById(String id) {
		// TODO Auto-generated method stub
		return userMapper.deleteByPrimaryKey(id)== 1 ? true:false;
	}

}
